package com.cat.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @author cat
 * @version 2025/5/27 20:16
 * @description
 * @since JDK17
 */

public class StudentAggregateImpl implements StudentAggregate {
    List<Student> list = new ArrayList<>();
    @Override
    public void addStudent(Student student) {
        list.add(student);
    }

    @Override
    public void removeStudent(Student student) {
        list.remove(student);
    }

    @Override
    public StudentIterator getStudentIterator() {
        return new StudentIteratorImpl(list);
    }
}
